package com.example.tliasmanagement.service.impl;

import com.example.tliasmanagement.dto.LogListDto;
import com.example.tliasmanagement.entity.Log;
import com.example.tliasmanagement.mapper.LogMapper;
import com.example.tliasmanagement.service.LogService;
import com.example.tliasmanagement.vo.LogListVo;
import com.example.tliasmanagement.vo.PageBean;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class LogServiceImpl implements LogService {
    @Autowired
    private LogMapper logMapper;
    /**
     * 分页查询
     */
    @Override
    public PageBean<Log> logs(LogListDto dto){
        PageHelper.startPage(dto.getPage(),dto.getPageSize());
        Page<Log> list = logMapper.page();
        return new PageBean(list.getTotal(),list.getResult());
    }
}
